/*
 * @lc app=leetcode.cn id=104 lang=cpp
 *
 * [104] 二叉树的最大深度
 */

// @lc code=start
/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode() : val(0), left(nullptr), right(nullptr) {}
 *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
 *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
 * };
 */
class Solution
{
public:
    int maxDepth(TreeNode *root)
    {
        /*
        //深度 递归比较简单
        if (root == NULL)
        {
            return 0;
        }
        else
        {
            return max(maxDepth(root->left), maxDepth(root->right)) + 1;
        }
        */
        //迭代写法
        queue<TreeNode *> que;
        int res = 0;
        if (root == NULL)
        {
            return 0;
        }
        que.push(root);
        while (!que.empty())
        {
            int size = que.size();
            TreeNode *node = que.front();
            for (int i = 0; i < count; i++)
            {
                /* code */
            }
            
            res++;
        }
        return res;
    }
};
// @lc code=end
